//
//  File.swift
//
//
//  Created by Tibor Bodecs on 2022. 02. 23..
//

import Fluent
import Molecular
import Vapor

public struct WebApi {
    private var db: Database

    public var menu: WebMenuApi { .init(.init(db)) }
    public var menuItem: WebMenuItemApi { .init(.init(db)) }
    public var page: WebPageApi { .init(.init(db)) }

    init(_ db: Database) {
        self.db = db
    }
}

public extension Request {
    var web: WebApi { .init(db) }
}
